//
//  BVService.h
//  AFNetworking
//
//  Created by 崔晋 on 2019/8/11.
//

#import <Foundation/Foundation.h>


NS_ASSUME_NONNULL_BEGIN

typedef void(^DownloadProgress)(NSProgress *progress);

@interface BVService : NSObject

+ (instancetype)shareInstance;

@property (nonatomic, assign, readonly) BOOL isWifi;

- (NSURLSessionDataTask *)post:(NSString * _Nonnull)url
                   requestBodt:(NSDictionary * _Nullable)param
                      complete:(void(^ _Nullable )(BOOL success, id _Nullable response))complete;

- (NSURLSessionDataTask *)put:(NSString * _Nonnull)url
requestBodt:(NSDictionary * _Nullable)param
   complete:(void(^ _Nullable )(BOOL success, id _Nullable response))complete;

- (NSURLSessionDataTask *)get:(NSString * _Nonnull)url
                         param:(NSDictionary * _Nullable)param
                      complete:(void(^ _Nullable )(BOOL success, id _Nullable response))complete;

- (NSURLSessionTask *)postImageWithUrl:(NSString *)url
                                 image:(UIImage *)image
                                   key:(NSString *)key
                              progress:(DownloadProgress)progress
                              complete:(void(^ _Nullable )(BOOL success, id _Nullable response))complete;;

- (NSURLSessionTask *)downloadVideoWithUrl:(NSString *)url
                                  progress:(DownloadProgress)progress
                                  complete:(void(^ _Nullable )(BOOL success, NSURL * _Nullable filePath))complete;

@end

NS_ASSUME_NONNULL_END
